﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Cemit.PolyServer.Lobby
{
    class Match : IMatch
    {
        public string ID { get; }
        public bool IsFull => m_Players.Count == m_FullNumber;
        public IEnumerable<Player> Players => m_Players;

        readonly short m_FullNumber;
        readonly List<Player> m_Players = new List<Player>();

        public Match(short fullNumber, string id)
        {
            m_FullNumber = fullNumber;
            ID = id;
        }

        public Match AddPlayer(Player player)
        {
            m_Players.Add(player);
            return this;
        }

        public Match RemovePlayer(Player player)
        {
            m_Players.Remove(player);
            return this;
        }
    }
}
